package com.service.impl;

import com.dao.WorkerDao;
import com.pojo.Page;
import com.pojo.Worker;
import com.service.WorkerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class WorkerServiceImpl implements WorkerService {

    @Autowired
    private WorkerDao workerDao;

    @Override
    public int addWorker(Worker w){
        return workerDao.addWorker(w);
    }

    @Override
    public int deleteWorkerById(long id){
        return workerDao.deleteWorkerById(id);
    }

    @Override
    public int updateWorker(Worker w){
        return workerDao.updateWorker(w);
    }

    @Override
    public Worker queryById(long id){
        return workerDao.queryById(id);
    }

    @Override
    public List<Worker> queryAllWorker() {
        return workerDao.queryAllWorker();
    }

    @Override
    public Worker queryByName(String text) {
        return workerDao.queryByName(text);
    }

    @Override
    public int countWorkers() {
        return workerDao.countWorkers();
    }

    @Override
    public List<Worker> queryWorkerByIdUp(Page page) {
        return workerDao.queryWorkerByIdUp(page);
    }

    @Override
    public List<Worker> queryWorkerByIdDown(Page page) {
        return workerDao.queryWorkerByIdDown(page);
    }

    @Override
    public List<Worker> queryWorkerByNameUp(Page page) {
        return workerDao.queryWorkerByNameUp(page);
    }

    @Override
    public List<Worker> queryWorkerByNameDown(Page page) {
        return workerDao.queryWorkerByNameDown(page);
    }

    @Override
    public List<Worker> queryWorkerByWorkageUp(Page page) {
        return workerDao.queryWorkerByWorkageUp(page);
    }

    @Override
    public List<Worker> queryWorkerByWorkageDown(Page page) {
        return workerDao.queryWorkerByWorkageDown(page);
    }


}
